﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Control_ViewLogin : System.Web.UI.UserControl
{
    string username = null;
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            username = Session["username"].ToString();
            if (username.Length != 0)
            {
                lbluser.Text = "Welcome " + username;
                HyperLink1.Text = "Logout";
                HyperLink1.NavigateUrl = "Default.aspx";

            }
            else
            {
                lbluser.Text = "Hi Tranger";
                HyperLink1.Text = "Login";
                HyperLink1.NavigateUrl = "../Login.aspx";
            }
        }
        catch (Exception)
        {

            lbluser.Text = "Hi Tranger";
            HyperLink1.Text = "Login";
            HyperLink1.NavigateUrl = "../Login.aspx";
        }
        
    }
}